package main.ressik;

import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;

public class CalendarView {
	
	private Main main;
	private DatePicker dp;
	private CalendarController cc;
	
	
	
	
	/**
	 * Constructor
	 */
	public CalendarView(){
		main = Main.getInstance();
		cc = new CalendarController();
	}
	
	
	
	
	/**
	 * Builds the List of foods that have been added for that particular day.
	 * This list needs to be rebuilt any time a change has been made (ie. a food
	 * has been added or removed).
	 */
	public void buildCalFoodList(){
		dp = (DatePicker) Main.getInstance().findViewById(R.id.date_picker);
		Button seeFoods_btn = (Button) Main.getInstance().findViewById(R.id.seeFoodsBtn);
		seeFoods_btn.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				cc.seeFoodsClick(main, getFlv());
			}
        });
		Button seeDetails_btn = (Button) Main.getInstance().findViewById(R.id.seeDetailsBtn);
		seeDetails_btn.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				cc.seeDetailsClick();
			}
        });
	}
	
	
	
	
	//Getters and Setters
	public DatePicker getDp() {
		return dp;
	}
	
	
	public void setDp(DatePicker dp) {
		this.dp = dp;
	}
	
	
	public FoodListView getFlv(){
		return main.getFlv();
	}
	
	
	
	

}
